//
//  MenuViewController.m
//  Flyer
//
//  Created by Brian Chung on 7/14/12.
//  Copyright (c) 2012 Stony Brook University Suny. All rights reserved.
//

#import "MenuViewController.h"
#import "GameStartViewController.h"
#import "HelpInfoViewController.h"
#import "ViewController.h"
@interface MenuViewController ()

@end

@implementation MenuViewController
@synthesize startGame;
@synthesize help;
@synthesize currentView;

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (IBAction)startGame:(UIButton *)sender {
    if(self.startGame==nil){
        self.startGame=[[GameStartViewController alloc] initWithNibName:@"GameStartViewController" bundle:nil];
    }
    //[self.view insertSubview:self.startGame.view atIndex:1];
    [startGame setCurrentView:currentView];
    self.view=nil;
    [currentView.view addSubview:startGame.view];
}

- (IBAction)helpMenu:(UIButton *)sender {
    [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:1.25];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    if(self.help==nil){
        self.help=[[HelpInfoViewController alloc] initWithNibName:@"HelpInfoViewController" bundle:nil];
    }
    [UIView setAnimationTransition:
     UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
    [self.view addSubview:self.help.view];
    
    [UIView commitAnimations];
}
@end
